create  table jms_dm.dm_day_deliver_aging_dt
(
virt_code   varchar(100) COMMENT '虚拟代理区code' ,
agent_code   varchar(100) COMMENT '代理区code' ,
fran_code    varchar(100) COMMENT '加盟商code' ,
code   varchar(100) COMMENT '网点code' ,
regional_id   varchar(100) comment '管理大区id',
regional_desc varchar(100) comment '管理大区',
virt_name   varchar(100) COMMENT '虚拟代理区' ,
agent_name   varchar(100) COMMENT '代理区' ,
fran_name    varchar(100) COMMENT '加盟商' ,
name     varchar(100) COMMENT '网点' ,
active_deliver_sum   int(12) COMMENT '实际出仓数量' ,
plan_delver_sum       int(12) COMMENT '计划出仓数量' ,
active_deliver_09    int(12) COMMENT '实际九点前出仓数量' ,
active_deliver_10    int(12) COMMENT '实际十点前出仓量' ,
active_deliver_11    int(12) COMMENT '实际11点前出仓量' ,
active_deliver_12    int(12) COMMENT '实际12点前出仓量' ,
plan_delver_hour_09   int(12) COMMENT '规划9点前出仓量' ,
plan_delver_hour_10    int(12) COMMENT '规划9点前出仓量' ,
plan_delver_hour_11     int(12) COMMENT '规划9点前出仓量' ,
plan_delver_hour_12     int(12) COMMENT '规划9点前出仓量' ,
date_time   date COMMENT '业务日期'
,order_source_code varchar(100) comment '订单来源code'
,order_source_name varchar(100) comment '订单来源'
 ,plan_active_deliver_09   int(10) comment '规划签收九点前实际出仓量')
ENGINE=OLAP
DUPLICATE KEY(virt_code,agent_code,fran_code,`code`)
comment '出仓当日时效签收监控'
PARTITION BY RANGE (date_time) (
   START ("2023-02-20") END ("2023-04-21") EVERY (INTERVAL 1 day))DISTRIBUTED BY HASH(code) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);
 alter table jms_dm.dm_day_deliver_aging_dt add column (
 plan_active_deliver_10   int(8) comment '规划签收十点前实际出仓量',
 plan_active_deliver_11   int(8) comment '规划签收十一点前实际出仓量',
 plan_active_deliver_12   int(8) comment '规划签收十二点前实际出仓量'
);